package com.distributer.delayqueue.delayqueue.consume;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.distributer.delayqueue.delayqueue.ConsumeQueueProvider;
import com.distributer.delayqueue.job.Job;

@Component("consoleComsumer")
public class ConsoleComsumer implements ConsumeQueueProvider{

	private static final Logger LOGGER = LoggerFactory.getLogger(ConsoleComsumer.class);
	
	@Override
	public void init() {
		
	}

	@Override
	public void comsumer(Job job) {
		SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-DD mm:hh:ss");
		LOGGER.info(String.format("消息编号： %s 达到执行时间,执行时间： %s！", job.getJobId(),dateFormat.format(new Date())));
	}

	@Override
	public void destory() {
		
	}

}
